import App from './App.svelte';
import messages, {fileList, users} from "../store.js";
import {Buffer} from "buffer";
// import { JSEncrypt } from "JSEncrypt";

export var logined=false;
export function setlogin(status=true) {
	logined=status
}
export var thisuser;
export function setuser(account){
	thisuser=account
}

export let wscoket;
export function setsocket(){
	wscoket=new WebSocket("ws://127.0.0.1:9999/ws")
}

export var ws;

export function wsrecon(){
	ws=new WebSocket("ws://"+location.host+"/ws")
}

// export var messages=[];
// export function setmessages(msgs){
// 	messages=msgs
// }
// export function getmessages() {
// 	return	messages
// }

const app = new App({
	target: document.body,
	props: {
		// name: 'world'
	}
});
//
// import crypto from "crypto";
export const publicKey = "-----BEGIN RSA Public Key-----\
        MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAst79ExyKJ1Bir60zkoK2\
        vB4Y6b178JcJSqEivGXachboxFakVx4c6RiVos7Vbua5qz5fXnHFhIGXJF1z8Uh2\
        9neJauYNZFXcUYgpRVfGpojSiOQpVkQGdxm4xwdzTCCfnAIgcElPXC1ucoRsiBzP\
        CR0ctzGzRBMMUNwCrGuMlchj24ieFvr4/FXa17b3CIr3Rw+NGC+O+19/ZO2VQ/iu\
        273c2r5uMqLwez3fJtgCNkVGHF77NoRBKYirK8bFIyoF8w01DFRiIGMEH1FoD3GT\
        zd1hbjAPigdVHWjjmyKfgxXr2a2TvAcYyXiAgD9fXweo3Qo2HUz10FhB9ghYm21m\
        IQIDAQAB\
        -----END RSA Public Key-----"


export default app;